﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using hse_2013_272_lines;

namespace hse_2013_272_lines.Tests
{
    [TestClass]
    public class FieldReactions
    {
        [TestMethod]
        public void PausingTest()
        {
            var field = new Field(null, null);
            field.Pause();
            Assert.IsTrue(field.paused);
        }

        [TestMethod]
        public void UnpausingTest()
        {
            var field = new Field(null, null);
            field.Pause();
            field.Continue();
            Assert.IsFalse(field.paused);
        }

        [TestMethod]
        public void MoveLeftTest()
        {
            var field = new Field(null, null);
            var x = field.activeShape.x;
            field.TryToMoveLeft();
            Assert.AreEqual(x - 1, field.activeShape.x);
        }

        [TestMethod]
        public void MoveRightTest()
        {
            var field = new Field(null, null);
            var x = field.activeShape.x;
            field.TryToMoveRight();
            Assert.AreEqual(x + 1, field.activeShape.x);
        }

        [TestMethod]
        public void MoveDownTest()
        {
            var field = new Field(null, null);
            var y = field.activeShape.y;
            field.TryToMoveDown();
            Assert.AreEqual(y + 1, field.activeShape.y);
        }
    }
}
